<%@ page import="java.util.Scanner" %><%--
  Created by IntelliJ IDEA.
  User: jackiechan
  Date: 2021/8/31
  Time: 09:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java"   %>
<html>
<head>
    <title>JSP语法</title>
</head>
<body>
<%--
基本语法,里面不能定义方法等
--%>
<%

    System.out.println("这是基本的脚本");
    int i = 10;
    System.err.println(i);
    Scanner scanner = new Scanner(System.in);
%>

<%
    i++;
    System.err.println(i);
%>

<%--
声明了一个成员变量 j 赋值为 100
--%>
<%! int j =100;%>
<%! int k =100;%>
<%--
声明了变量和方法
--%>
<%!
    int a = 10;
    int b = 100;
    int c = 99;
    String s = new String("dasdasd");
    public  int sum(int a,int b){
        return a + b;
    }
%>


<%= c%>

<%=  sum(100,22344)%>
<!--
    这是啥???html 中的注释
-->
</body>
</html>
